package com.shadow.demo.dictionary.common.data;


import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 属性类
 *
 * @author penggch
 *
 */
public class Property implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 6333086657029726371L;

    private String name;
    private Object value;
    private String type;
    private Map<String, Object> props;

    public Property() {

    }

    public Property(String name, Object value) {
        this.name = name;
        this.value = value;
    }

    public Property(String name, Object value, String type) {
        this.name = name;
        this.value = value;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Map<String, Object> getProps() {
        return props;
    }

    public void setProps(Map<String, Object> props) {
        this.props = props;
    }

    public void put(String key, Object value) {
        if (props == null) {
            props = new HashMap<String, Object>();
        }
        props.put(key, value);
    }

    public Object get(String key) {
        if (props != null) {
            return props.get(key);
        }
        return null;
    }
}
